User blog:Imper1um/Extraction Process
I've got a few questions on how extraction works, and if they could help. First of all, all of my extractions are done via code. During the time in which I'm figuring out the game, its actually not booted up. I don't see a single Sprite on my screen. Instead, I see something like this: This code here may mean nothing to you, but it shows me how the system is auto-saving your Stage when you reach the end of the game. As you can see, some of the games are in english (Class, Stage, Game), but some of them are in Japanese/Korean/Chinese/Not English (asobikatamc, backkuroAmc, backkuromozaikumc). While this hinders things, since the primary parts of code are in english (function, var), its actually pretty easy for me to see what its doing. The hard part is actually translating it from code to pure English. While I can know how it works in my head, translating it from Computer Speak into English Speak is actually quite difficult, mainly because computers operate different than normal spoken speak. Pulling out the Code Pulling out the code is actually very straightforward. All of the APKs are really just "ZIP" files which contain an infrastructure. A lot of games actually use Adobe's AIR Framework, which takes a .SWF and puts it on your Android screen. The Adobe AIR Infrastructure is actually quite insecure, and so, extracting the code from it is almost as easy as extracting the APK. It can be decompiled by a program called "FlashDecompile" which separates it into ActionScript files, Sprites, Music and other fun tidbits, ripe for the extraction. Reading the Code One thing that is difficult for me to comprehend is how the system is actually built. ActionScript doesn't use Arrays like my well-known programming language, C#, in which I have 7 years of professional experience, and 14 years of non-professional experience. Instead, ActionScript is still object oriented, but the syntax is almost...backwards. For example, in C#, variables start with the type qualifier (int), followed by the name, then the default value. ActionScript switches these around and has var at the beginning, so it can confuse me at times. In C#, var is also a type qualifier like int, but var also means it can vary what type is loaded, and it depends on the default value to determine the type of object that is initialized. In order to order my thoughts, I actually use a C# Program, and I built a converter, which allows me to view the values of everything by doing the exact same thing that the game is doing, just not with Sprites. At the moment, I'm building a suite to simulate a battle. Its my hope that I can actually write a utility that can figure out the percentage chance that you will die in an encounter. At the moment, I've got one screen completed: MapMimic, which allows me to see all of the Stage Data in a singular format. While this isn't much, it also allows me to extract the stage values for use in the Point Value Calculation Extraction task, of which I am working on now. Writing the Code When I write down the code, I'm not doing much to actually "convert" what is going on. I write it down exactly how it looks in code, just in its C# equivalent. This also annoys me greatly, because when I look at the code, I want to criticize it, and rewrite it so that way its more efficent, but I keep forgetting that I'm not trying to improve the code, I'm trying to figure out what its doing, so, efficiency aside, I just simply write exactly what goes on. Writing it in C#, also comes with its own issues. I will have Compile errors all over the place, until I figure out if that the code is useless, or I write the definition for the code later down the road. An example is here, where I've written the save function for StageMap, but all of the variables haven't been written yet, so there's so many red text, which makes my head hurt when just looking at it. However, this red text goes away as I write the variable definitions down below. The worst part is that the system depends on many other things, and I can't execute my code until all of them have been solved. Also, the fun part is trying to decipher between something setting a sprite graphic (useless to code), and setting a variable used in Battle Calculations. While I don't really care how big a bitmap should be on the Battle Variable, I do care about how it figures out the drop rate of the monster, and its chance for appearing in the zone. Category:Blog posts